home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11816 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.4 KB  |  47 lines

  1. Newsgroups: comp.lang.c,comp.lang.c++
  2. Path: newsfeed.tip.net!pm1!news
  3. From: Daniel Marell <Daniel.Marell@Contactor.se>
  4. Subject: Re: HELP! On how to declare large arrays.
  5. X-Nntp-Posting-Host: foxton
  6. Content-Type: text/plain; charset=us-ascii
  7. Message-ID: <3149EB16.1943@Contactor.se>
  8. Sender: news@contactor.se (Net News)
  9. Content-Transfer-Encoding: 7bit
  10. Organization: Objekt-Makarna AB
  11. References: <lynch-1303962017180001@mac50.sask.trlabs.ca>
  12. Mime-Version: 1.0
  13. Date: Fri, 15 Mar 1996 22:11:34 GMT
  14. X-Mailer: Mozilla 2.0 (WinNT; I)
  15.  
  16. Throw out you old DOS and Windows 3.11. Switch to Windows NT or Linux and say 
  17. forever goodbye to 16-bit and segmentation. Or at least switch to the 
  18. temporary surrogate Windows 95. If you insist to keep your old DOS, try a DOS 
  19. extender. I've tried Pharlap TNT. It can run native Win32-console applications 
  20. on a tiny DOS-PC.
  21.  
  22. While you are waiting for your new Windows NT-installation to finish, try this:
  23.  
  24. #include <complex.h>
  25.  
  26. void
  27. main()
  28. {
  29.    complex* complexArray[512];   // Array of 512 pointers to complex
  30.    int a, b;
  31.  
  32.    // Let each element in the 512-array point to an array of 128 elements each
  33.    for (a = 0; a < 512; a++)
  34.       complexArray[a] = new complex[128];
  35.  
  36.    // Initialize it
  37.    for (a = 0; a < 512; a++)
  38.    {
  39.       for (b = 0; b < 128; b++)
  40.       complexArray[a][b] = 0;
  41.    }
  42.  
  43.    // ...
  44. }
  45.  
  46. I hope this is what you are looking for.
  47.